import pandas as pd

COUNT = 100


class QuestionBank:
    def __init__(self, file_name):
        self.df = pd.read_excel(file_name)
        self.programming_questions = self.df[self.df['题型'] == '编程题']
        self.selected_questions = self.programming_questions.head(COUNT)

    def display_questions(self):
        queries = []
        for index, row in self.selected_questions.iterrows():
            question = row['题干']  # 假设问题字段名为 'question'
            # print(f"索引:{index}\t题目: {question[:40]}\n")
            queries.append(question)  # 将问题添加到列表中
        return queries
